#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPainter>
#include <QPainterPath>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::paintEvent(QPaintEvent *event){
    QPainter painter;
    QPainterPath paintPath;
    painter.begin(this);
    paintPath.moveTo(50, 50);
    paintPath.addEllipse(50, 50, 100, 100);
    paintPath.moveTo(100, 50);
    paintPath.cubicTo(50, 75, 150, 125, 100, 150);
    paintPath.addEllipse(110, 75, 10, 10);
    paintPath.addEllipse(85, 125, 10, 10);

    QPen pen(Qt::green, 5);
    painter.setPen(pen);
    painter.drawPath(paintPath);
    painter.end();
}
